package com.hfjy.bigdata.exception;

import com.hfjy.bigdata.util.Result;
import com.hfjy.bigdata.util.ResultUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {
    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public Result handle(Exception e){
        return ResultUtil.error(e.getMessage());
    }
}
